﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;

namespace DAL.Persistencia
{
    public class SqlCon
    {

        public SqlConnection Con;

        public SqlCommand Cmd;

        public SqlDataReader Dr;   

        public void AbrirConexao()
        {
            string[] pars = ConfigurationManager.ConnectionStrings["NewTierraEntities"].ToString().Split('\"');
            Con = new SqlConnection(pars[1]);            
            Con.Open(); 
        }

        public void FecharConexao()
        {
            if(Con != null) 
            {
                Con.Close(); 
            }
        }


    }
}
